//Multicast Receiver

// Range of multicast IP address : 224.0.0.0 - 239.255.255.255

import java.io.*;
import java.net.*;

public class MulticastReceiver
{
  public static void main( String[] args )
  {
    MulticastSocket s;
    InetAddress group;

    try{
         group = InetAddress.getByName("239.230.1.1");
         s = new MulticastSocket( 54321 );
         s.joinGroup( group );
         
         byte[] buf = new byte[100];
         DatagramPacket recv = new DatagramPacket( buf, buf.length );

         s.receive( recv );
         System.out.println( new String( buf ));
         s.close();

        }catch(Exception e)
           {
             e.printStackTrace();   
    
           }
  

   

  }//End main


}//End MulticastReceiver
